@echo off
echo ========================================
echo    完整设置Nginx显示前端页面
echo ========================================

echo.
echo 1. 停止当前Nginx...
D:\nginx\nginx-1.29.1\nginx-1.29.1\nginx.exe -s stop 2>nul

echo.
echo 2. 创建必要的目录...
mkdir "D:\nginx\nginx-1.29.1\nginx-1.29.1\logs" 2>nul
mkdir "D:\nginx\nginx-1.29.1\nginx-1.29.1\temp" 2>nul

echo.
echo 3. 备份原配置文件...
copy "D:\nginx\nginx-1.29.1\nginx-1.29.1\conf\nginx.conf" "D:\nginx\nginx-1.29.1\nginx-1.29.1\conf\nginx.conf.backup" 2>nul

echo.
echo 4. 复制我们的配置文件...
copy "D:\pycharam\PycharmProjects\anr-analyzer\nginx.conf" "D:\nginx\nginx-1.29.1\nginx-1.29.1\conf\nginx.conf"

echo.
echo 5. 启动Nginx...
cd /d "D:\nginx\nginx-1.29.1\nginx-1.29.1"
nginx.exe

echo.
echo ========================================
echo    配置完成！
echo    现在访问: http://localhost
echo    应该能看到ANR分析工具页面
echo ========================================

pause


